package com.leo.staffmanagement.controller;

import com.leo.staffmanagement.bean.User;
import com.leo.staffmanagement.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class LoginController {

    @Autowired
    UserDao userDao;

    @RequestMapping("/logins")
    public String login(@RequestBody User user){
        User us = userDao.getUserByMessage(user.getUsername(),user.getPassword());
        System.out.println(us);
        return "ok";
    }
}
